package com.ddyx.common.base.enums;

/**
 * 自定义异常常量
 * @author agula
 * @date 2019-07-12 16:03
 */
public enum ApiResultType {

	/**
	 * *************系统级异常*******************
	 */
	UNKNOWN_EXCEPTION(-3, "未知异常"),
	REQUEST_FAILED(-2, "请求失败"),
	PARAMER_ERROR(-1, "请求参数异常"),
	SUCCESS(0, "请求成功"),
	TOKEN_ERROR(1, "token失效"),
	VERIFYCODE_ERROR(2, "验证码错误"),
	VERIFYCODE_EXPIRE(3, "验证码过期"),
	NOUPDATE(4, "APP版本无更新"),
	VERIFYCODE_COUNT(5, "验证码次数超过限制"),

	/**
	 * *************模块级异常*******************
	 */
	/***用户USER****/
	USER_NOTBIND(101, "微信未绑定手机号码"),
	USER_EXIST(102, "手机号码已注册"),
	USER_USER_PASS_ERROR(103, "用户名或密码错误"),
	USER_NOT_REGSTER(104, "手机号码未注册"),
	USER_DISABLE(105, "手机号码已禁用"),
	USER_BIND(106, "手机号码已绑定微信"),
	INVALID_USER(107, "不是有效用户或用户未激活"),

	/***订单ORDER****/
	ORDER_NOTBIND(201, "xxx"),
	ORDER_EXIST(202, "xxx"),
	ORDER_ERROR(203, "xxx"),

	/***会员MEMBER****/
	MEMBER_NOTBIND(301, "xxx"),
	MEMBER_EXIST(302, "xxx"),
	MEMBER_ERROR(303, "xxx"),

	/***门店STORE****/
	STORE_NOTBIND(401, "xxx"),
	STORE_EXIST(402, "xxx"),
	STORE_ERROR(403, "xxx"),

	;

	private Integer code;
	private String message;

	ApiResultType(Integer errorCode, String errorMsg) {
		this.code = errorCode;
		this.message = errorMsg;
	}

	public Integer getCode() {
		return code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

}
